<%--
  Created by IntelliJ IDEA.
  User: xuweijie
  Date: 17-5-12
  Time: 下午7:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/header.jsp" %>
<html>
<head>
    <title>购物车</title>
    <link rel="stylesheet" href="${Layui}/css/layui.css" media="all">
    <script src="${Layui}/layui.js" charset="utf-8"></script>
    <script src="${jquery}/jquery-3.1.1.js" charset="utf-8"></script>
    <script src="${Js}/admin/buycars.js" charset="utf-8"></script>
</head>
<body style="margin-left:10px;margin-right: 10px">
<c:if test="${croPurchase!=null}">
    <input type="text" value="${pageIndex}" hidden id="pageIndex">
    <input type="text" value="${pageCount}" hidden id="pageCount">
    <input type="text" value="${customerid}" hidden id="customerid">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>订单详情</legend>
    </fieldset>
    <table class="layui-table" lay-even="" lay-skin="nob">
        <colgroup>
            <col width="80">
            <col width="200">
            <col width="200">
            <col width="200">
            <col width="200">
            <col width="200">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>订单号</th>
            <th>顾客姓名</th>
            <th>总价</th>
            <th>创建时间</th>
            <th>订单类型</th>
            <th>订单状态</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>${croPurchase.id}</td>
            <td>${croPurchase.croCustomer.username}</td>
            <td>${croPurchase.totalprice}</td>
            <td><fmt:formatDate value="${croPurchase.createdate}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
            <td>${SysDict['order_type'][croPurchase.orderType]}</td>
            <td>${SysDict['has_order_status'][croPurchase.order_flag]}</td>
        </tr>
        </tbody>
    </table>
<%--商品信息--%>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>购物车信息</legend>
    </fieldset>

    <table class="layui-table" lay-even="" lay-skin="row">
        <colgroup>
            <col width="50">
            <col width="150">
            <col width="300">
            <col width="50">
            <col width="50">
            <col width="50">
            <col width="50">
            <col width="50">
            <col width="80">
        </colgroup>
        <thead>
        <tr>
            <th>序号</th>
            <th>商品名称</th>
            <th>商品描述</th>
            <th>图片</th>
            <th>原价</th>
            <th>成交价</th>
            <th>购买数量</th>
            <th>总价</th>
            <th>操作</th>
        </tr>
        </thead>
        <c:set var="i" value="${0}" />
        <c:forEach items="${goodsdetails}" var="goods">
            <tr>
                <c:set var="i" value="${i+1}" />
                <td>${i}</td>
                <td>${goods.name}</td>
                <td>${goods.describ}</td>
                <td><img src="${goods.photo}" width="32px" height="32px"></td>
                <td>${goods.price}</td>
                <td>${goods.actprice}</td>
                <td>${goods.numbers}</td>
                <td>${goods.sumprice}</td>
                <td>
                    <div class="layui-btn-group">
                        <a data-method="update" buycarid="${goods.id}" customerid="${customerid}" class="layui-btn layui-btn-small layui-btn-normal updatebuycar">
                            <i class="layui-icon">&#xe642;</i>
                        </a>
                        <a data-method="delete" buycarid="${goods.id}" customerid="${customerid}" class="layui-btn layui-btn-small layui-btn-danger delbuycar">
                            <i class="layui-icon">&#xe640;</i>
                        </a>
                    </div>
                </td>
            </tr>
            </c:forEach>
        </tbody>
    </table>
    <div id="buycarpage"></div>
</c:if>
<c:if test="${croPurchase==null}">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>该用户购物车内暂无商品</legend>
    </fieldset>

</c:if>

<%--更新弹出框样式--%>
<form id="updatebuycar" class="layui-form" hidden>
    <br>
    <div class="layui-form-item">
        <label class="layui-form-label">商品名称</label>
        <div class="layui-input-block">
            <input disabled type="text" id="goodname" name="goodname" autocomplete="off" class="layui-input" style="width: 95%">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">成交价</label>
        <div class="layui-input-block">
            <input  type="text" id="actprice" name="actprice"  required  lay-verify="required" placeholder="请输入成交价" autocomplete="off" class="layui-input" style="width: 95%">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">购买数量</label>
        <div class="layui-input-block">
            <input type="text" id="numbers" name="numbers" required  lay-verify="required" placeholder="请输入数量" autocomplete="off" class="layui-input" style="width: 95%">
        </div>
    </div>
</form>

</body>
</html>
